﻿<Window x:Class="RSSFeedReader.Views.ChannelPropertiesView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:converter="clr-namespace:RSSFeedReader.Converters"
        xmlns:res="clr-namespace:RSSFeedReader.Resources"
        Title="{x:Static res:Strings.ChannelPropertiesView_Title}"
        Height="285"
        Width="420"
        WindowStartupLocation="CenterOwner"
        ResizeMode="NoResize"
        ShowInTaskbar="False">
    <Window.Resources>
        <!--CopyLink ContextMenu-->
        <ContextMenu x:Key="CopyLinkCtxMenu">
            <MenuItem Header="{x:Static res:Strings.CopyLinkCtxMenu_Header}"
                      Command="{Binding Path=CopyLinkCommand}" />
        </ContextMenu>
        <converter:ImageNotAvailableConverter x:Key="ImageNotAvailableConverter" />
    </Window.Resources>
    <Border Opacity="0.85">
        <Border.Background>
            <LinearGradientBrush EndPoint="0.5,1"
                                 StartPoint="0.5,0">
                <GradientStop Color="#FF0A0A0A"
                              Offset="0" />
                <GradientStop Color="#FF404040"
                              Offset="0.995" />
                <GradientStop Color="#FF000000"
                              Offset="0.525" />
                <GradientStop Color="#FF000000"
                              Offset="0.723" />
                <GradientStop Color="#FF000000"
                              Offset="0.286" />
                <GradientStop Color="#FF1A1A1A"
                              Offset="0.848" />
            </LinearGradientBrush>
        </Border.Background>
        <Border BorderThickness="1,1,1,1">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0">
                    <GradientStop Color="#4CFFFFFF"
                                  Offset="0" />
                    <GradientStop Color="#00FFFFFF"
                                  Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="10" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="10" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="10" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="20" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="10" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Label Name="nameLabel"
                       Content="{x:Static res:Strings.ChannelPropertiesView_NameLabel}"
                       Foreground="White"
                       HorizontalAlignment="Left"
                       Target="{Binding ElementName=nameTB}"
                       Grid.Row="1"></Label>
                <TextBox Text="{Binding Path=Title, Mode=OneWay}"
                         Grid.Column="1"
                         Name="nameTB"
                         Grid.Row="1"
                         Margin="3,0"
                         Background="#FF000000"
                         Foreground="#FFFFFFFF">
                    <TextBox.BorderBrush>
                        <LinearGradientBrush EndPoint="0,20"
                                             StartPoint="0,0"
                                             MappingMode="Absolute">
                            <GradientStop Color="#FFDBD79F"
                                          Offset="0" />
                            <GradientStop Color="#FF168BFF"
                                          Offset="1" />
                        </LinearGradientBrush>
                    </TextBox.BorderBrush>
                </TextBox>
                <Label Grid.Row="3"
                       Height="28"
                       Name="addressLabel"
                       Foreground="White"
                       HorizontalAlignment="Left"
                       Content="{x:Static res:Strings.ChannelPropertiesView_AddressLabel}"
                       Target="{Binding ElementName=addressTB}"></Label>
                <TextBox Grid.Column="1"
                         Grid.Row="3"
                         Name="addressTB"
                         Text="{Binding Path=Url, Mode=OneWay}"
                         IsReadOnly="True"
                         Margin="3,0"
                         Background="#FF000000"
                         Foreground="#FFFFFFFF">
                    <TextBox.BorderBrush>
                        <LinearGradientBrush EndPoint="0,20"
                                             StartPoint="0,0"
                                             MappingMode="Absolute">
                            <GradientStop Color="#FFDBD79F"
                                          Offset="0" />
                            <GradientStop Color="#FF168BFF"
                                          Offset="1" />
                        </LinearGradientBrush>
                    </TextBox.BorderBrush>
                </TextBox>
                <Grid Name="imageContainerGrid"
                      Grid.Row="5"
                      Grid.ColumnSpan="2"
                      Margin="0,0,0,3">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Image Name="imageUrl"
                           Source="{Binding Path=ImageUrl, Mode=OneWay, Converter={StaticResource ImageNotAvailableConverter}}"
                           Margin="5,0,0,0"
                           Width="150"
                           Height="100"
                           VerticalAlignment="Top"
                           HorizontalAlignment="Left"></Image>
                    <TextBlock Name="descriptionTextBlock"
                               TextWrapping="Wrap"
                               MaxHeight="200"
                               Foreground="White"
                               Text="{Binding Path=Description, Mode=OneWay}"
                               Grid.Column="1"
                               Margin="5,0,3,0"></TextBlock>
                </Grid>
                <TextBlock x:Name="_homepageTextBlock"
                           Grid.Row="6"
                           HorizontalAlignment="Left"
                           VerticalAlignment="Center"
                           Margin="5,0,0,0"
                           ContextMenu="{StaticResource CopyLinkCtxMenu}">                        
                        <Hyperlink Command="{Binding Path=GoToHomepageCommand}">
                            <InlineUIContainer>
                    			<TextBlock Text="{x:Static res:Strings.ChannelPropertiesView_VisitWebSiteLink}"
                                           FontWeight="Bold"
                                           Foreground="#FFA7A7A7"
                                           TextDecorations="Underline" />
                    		</InlineUIContainer>
                        </Hyperlink>
                    </TextBlock>
                <Button Height="23"
                        Width="80"
                        Margin="117,0,3,6"
                        Name="okBtn"
                        VerticalAlignment="Bottom"
                        HorizontalAlignment="Right"
                        IsDefault="True"
                        Grid.Row="9"
                        Content="{x:Static res:Strings.Common_OKButton}"
                        Command="{Binding Path=OKCommand}"
                        CommandParameter="{Binding ElementName=nameTB, Path=Text}"
                        Template="{StaticResource GlassButton}"
                        Foreground="White"
                        Grid.Column="1"></Button>
                <!--<Button Height="23"
                        Width="80"
                        Margin="0,0,7,6"
                        Name="cancelBtn"
                        VerticalAlignment="Bottom"
                        IsCancel="True"
                        Grid.Row="9"
                        Content="{x:Static res:Strings.ChannelPropertiesView_CancelButton}"
                        Template="{DynamicResource GlassButton}"
                        Foreground="White"
                        Grid.Column="1"
                        HorizontalAlignment="Right"></Button>-->
            </Grid>
        </Border>
    </Border>
</Window>
